<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025/5/4
  Time: 16:06
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page import="com.project.DB_User" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%
  String name = request.getParameter("name");
  String pid = request.getParameter("pid");
  String email = request.getParameter("email");
  String phone = request.getParameter("phone");
  String identity = request.getParameter("identity");
  String password = request.getParameter("password");

  List<String> addInput = new ArrayList<>();
  addInput.add(name);
  addInput.add(pid);
  addInput.add(email);
  addInput.add(phone);
  addInput.add(identity);
  addInput.add(password);

  DB_User dbUser = new DB_User();
  boolean addResult = dbUser.add(addInput);

  if (addResult) {
    response.sendRedirect("index.jsp");
  } else {
    out.println("添加用户失败");
  }
%>